var Report = {
	currentId: null,
	listInit: function(){
		Report.trainpointJump(1);
	},
	trainpointClick: function(pageno){
		var cont = GetLS("cont");
      	Report.trainpointJump(pageno);
      	$("#pager").pager({pagenumber: pageno, pagecount: cont, buttonClickCallback: Report.trainpointClick });
	},
	trainpointJump: function(pageno){
		var count = Res.sinCount;
      	var start = (pageno-1)*count;
		$ajax({
			url:"/report/list",
			data:{
				start: start,
				count: count
			},
			success: function(res){
				var cont = parseInt(res.result.count/Res.sinCount);
                if((res.result.count)%Res.sinCount!=0){
                     cont++;
                }
                SetLS("cont",cont);
                if($("#pager").children().length == 0)
                    $("#pager").pager({ pagenumber: pageno, pagecount: cont, buttonClickCallback: Report.trainpointClick });
			
				var html =  '<thead><tr>'+
                            '<th class="span4">举报对象</th>'+  
                            '<th class="span6">举报理由</th>'+
                            '<th class="span2">操作</th>'+
	                    	'</tr></thead><tbody>';
	            var items = res.result.results;
	            for (var i=0; i<items.length; i++) {
	            	var btnHtml = '<button class="">举报</button> ';
	            	html += '<tr data-pos="'+ i +'">'+
	            				'<td>'+ items[i].from_user.name +'</td>'+ 
	            				'<td>'+ items[i].content +'</td>'+ 
	            				'<td>'+ 
								"<a data-id='" + items[i]._id + "' class='btn btn-danger  btn-mini'>审核</i></a>" +'</td>'+
	            				 +'</td>'+
	            			'</tr>';

	            }
	            html += '</tbody>';
	            $("#listCtn").html(html);
			      
			}
		});	       
	},

}